<?php

/**
 * @Author:  Groube
 * @Date:    2017-03-09 17:50:00
 * @version  $Id$
 */

class ZhuyuanXunchaJiluModel extends BaseModel {

    //返回给终端的可执行sql语句的字段名称数组
    public $_field_arr = [
        'id',
        'zhuyuan_id',
        'xuncha_time',
        'xuncha_hushi_id',
        'xuncha_hushi_name'
    ];

    public function ls($zhuyuan_xuncha_jilu,$zhuayun_bingren,$yiyuan_id){
        $field_str = 'id,zhuyuan_id,xuncha_time,xuncha_time,xuncha_hushi_id,xuncha_hushi_name';
        $query = DB::select($field_str)->from($zhuyuan_xuncha_jilu)
            ->where('zhuyuan_id','IN',$zhuayun_bingren)
            ->where('yiyuan_id','=',$yiyuan_id)
            ->execute()
            ->as_array();

        return $query;
    }

    public function getXunchaJiluDetail($ids)
    {
        $data = DB::select()->from('zhuyuan_xuncha_jilu_detail')
            ->where("xuncha_jilu_id","in",$ids)
            ->execute()
            ->as_array();
        return $data;
    }
}
